package com.cencat.serice.Impl;

import com.cencat.domain.Student;
import com.cencat.mapper.StudentMapper;
import com.cencat.serice.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    public List<Student> getAll() {
        return studentMapper.getAll();
    }

    @Override
    public Student getStudentById(int id) {
        return studentMapper.getById(id);
    }

    @Override
    public void save(Student student) {
        studentMapper.save(student);

    }

    @Override
    public void update(Student student) {
        studentMapper.update(student);
    }

    @Override
    public void delete(int id) {
        studentMapper.delete(id);

    }

    @Override
    public List<Student> getStudentsBypage(int page, int size) {
        return studentMapper.getStudentsBypage(page,size);
    }
}
